@extends('layouts.admin')
@section('content')
    {{--面包屑导航开始--}}
    <div class="crumb_warp">
        <i class="fa fa-home"></i><a href="{{url('admin/info')}}">首页</a> &raquo; 文章管理

    </div>
    {{--面包导航结束--}}


    <div class="result_wrap">
        <div class="result_title">
            <h3>编辑文章</h3>
            {{--打印错误信息--}}
            @if(count($errors)>0)
                <div class="mark">
                    @foreach($errors->all() as $error)
                        <p> {{$error}}</p>
                    @endforeach
                </div>
            @endif
        </div>
        <div class="result_content">
            <div class="short_wrap">
                <a href="{{url('admin/article/create')}}"><i class="fa fa-plus"></i>添加文章</a>
                <a href="{{url('admin/article')}}"><i class="fa fa-recycle"></i>全部文章</a>
            </div>
        </div>
    </div>
    <div class="result_wrap">
        <form action="{{url('admin/article/'.$field->art_id)}}" method="post">
            <input type="hidden" name="_method" value="put">
            {{csrf_field()}}
            <table class="add_tab">
                <tbody>
                <tr>
                    <th width="120">分类：</th>
                    <td>
                        <select name="cat_id">
                            {{--<option value="0">==顶级分类==</option>--}}
                            {{--获取动态分类【create中的方法获取的$data】--}}
                            @foreach($data as $d)
                                <option value="{{$d->cat_id}}" @if($field->cat_id == $d->cat_id) selected @endif >{{$d->_cat_name}}</option>
                            @endforeach

                            {{--<option value="20">推荐界面</option>--}}
                        </select>
                    </td>
                </tr>

                <tr>
                    <th><i class="require">*</i>文章标题：</th>
                    <td>
                        <input type="text" name="art_title"  class="lg" value="{{$field->art_title}}">

                    </td>
                </tr>
                <tr>
                    <th>编辑：</th>
                    <td>
                        <input type="text" name="art_editor"  class="sm" value="{{$field->art_editor}}">
                    </td>
                </tr>
                <tr>
                    <th>缩略图：</th>
                    <td>
                        <img id="art_thumb_img" style="width:300px;height:200px" src="{{$field->art_thumb}}">

                    </td>
                </tr>
                <tr>
                    <th>关键词：</th>
                    <td>
                        <input type="text" size="50" name="art_tag" value="{{$field->art_tag}}">
                    </td>
                </tr>
                <tr>
                    <th>描述：</th>
                    <td>
                        <textarea name="art_description">{{$field->art_description}}</textarea>

                    </td>
                </tr>

                <tr>
                    <th>文章内容：</th>
                    <td>
                        <script type="text/javascript" charset="utf-8" src="{{asset('plugin/ueditor/ueditor.config.js')}}"></script>
                        <script type="text/javascript" charset="utf-8" src="{{asset('plugin/ueditor/ueditor.all.js')}}"></script>
                        <script type="text/javascript" charset="utf-8" src="{{asset('plugin/ueditor/lang/zh-cn/zh-cn.js')}}"></script>
                        <script id="editor" name="art_content" type="text/plain" style="width:860px;height:500px;">{!! $field->art_content !!}</script>
                       <script type="text/javascript">
                           //实例化编辑器
                           var ue =UE.getEditor('editor');
                       </script>
                        <style>
                            /*UEDITOR 样式矫正*/
                            .edui-default{line-height: 28px;}
                            div.edui-combox-body,div.edui-button-body,div.edui-splitbutton-body{
                                overflow:hidden;height: 20px;
                            }
                            div.edui-box{overflow:hidden;height:22px;}
                        </style>



                    </td>
                </tr>



                <tr>
                     <th></th>
                    <td>
                        <input type="submit" value="提交">
                        <input type="button" class="back" onclick="history.go(-1)" value="返回">
                    </td>
                </tr>
                </tbody>
            </table>
        </form>


    </div>

@endsection